package com.ocom.company.controller;

import com.ocom.common.constant.CompanyServiceUrl;
import com.ocom.common.entity.human.EntityBizApply;
import com.ocom.common.resp.Result;
import com.ocom.common.utils.ResultUtil;
import com.ocom.company.service.BizApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class BizApplyController {
    @Autowired
    private BizApplyService bizApplyService;

    @PostMapping(CompanyServiceUrl.URL_getApplyListByPid)
    public Result getApplyListByPid(@RequestBody EntityBizApply entityBizApply){
        return ResultUtil.success(this.bizApplyService.getApplyListByPid(entityBizApply.getComId(), entityBizApply));
    }

    @PostMapping(CompanyServiceUrl.URL_newBizApply)
    public Result newBizApply(@RequestBody EntityBizApply entityBizApply){
        return ResultUtil.success(this.bizApplyService.addApply(entityBizApply.getComId(),entityBizApply));
    }

    @PostMapping(CompanyServiceUrl.URL_updateBizApply)
    public Result updateBizApply(@RequestBody EntityBizApply entityBizApply){
        return ResultUtil.success(this.bizApplyService.update(entityBizApply.getComId(),entityBizApply));
    }
}
